package com.gy.api;


import com.aaa.vo.Result;
import com.gy.service.CareHistoryService;
import com.gy.service.CareHistoryServiceDto;
import com.gy.vo.OrderChargeDtoListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author GaoYa
 * @Date 2023/3/25 10:30
 * @Version 1.5
 */
@RestController
@RequestMapping("/charge/api/")
public class CareHistoryController {
    @Autowired
    private CareHistoryService careHistoryService;

    @Autowired
    private CareHistoryServiceDto careHistoryServiceDto;

    /**
     * 处方收费查询
     * @param regId
     * @return
     */
    @GetMapping("findByUserId/{regId}")
    public Result<Map<String,Object>> findByUserId(@PathVariable String regId){
        return careHistoryService.findByUserId(regId);
    }

    /**
     * 处方退费查询
     * @param regId
     * @return
     */
    @GetMapping("BackFeeUserId/{regId}")
    public Result<Map<String, Object>> BackFeeUserId(@PathVariable String regId){
        return  careHistoryService.BackFeeUserId(regId);
    }

    /**
     * 处方发药查询
     * @param regId
     * @return
     */
    @GetMapping("BackFeeItemUserId/{regId}")
    public Result<Map<String, Object>> BackFeeItemUserId(@PathVariable String regId){
        return  careHistoryService.BackFeeItemUserId(regId);
    }

    /**
     *
     * 现金支付
     * @param orderChargeDtoListVo
     * @return
     */
    @PostMapping("XJOrder")
    public Result XJOrder(@RequestBody OrderChargeDtoListVo orderChargeDtoListVo){
        return careHistoryServiceDto.XJOrder(orderChargeDtoListVo);
    }

    /**
     * 现金退费
     */
    @PostMapping("XJBackFee")
    public Result XJBackFee(@RequestBody OrderChargeDtoListVo orderChargeDtoListVo){
        return careHistoryServiceDto.XJBackFee(orderChargeDtoListVo);
    }

}
